package bb.lanxing.lib.devices.ble.heartrate;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public interface IRemoteHeartRateBeltController extends IInterface {


    class Default implements IRemoteHeartRateBeltController {
        @Override
        public IBinder asBinder() {
            return null;
        }

        @Override
        public boolean closeWarnHr() throws RemoteException {
            return false;
        }

        @Override
        public void initWarnHr() throws RemoteException {
        }

        @Override
        public boolean setWarnHr(int i) throws RemoteException {
            return false;
        }
    }

    boolean closeWarnHr() throws RemoteException;

    void initWarnHr() throws RemoteException;

    boolean setWarnHr(int i) throws RemoteException;


    abstract class Stub extends Binder implements IRemoteHeartRateBeltController {
        private static final String DESCRIPTOR = "bb.lanxing.lib.devices.ble.heartrate.IRemoteHeartRateBeltController";
        static final int TRANSACTION_setWarnHr = 1;
        static final int TRANSACTION_closeWarnHr = 2;
        static final int TRANSACTION_initWarnHr = 3;

        @Override
        public IBinder asBinder() {
            return this;
        }

        public Stub() {
            attachInterface(this, DESCRIPTOR);
        }

        public static IRemoteHeartRateBeltController asInterface(IBinder iBinder) {
            if (iBinder == null) {
                return null;
            }
            IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
            if ((queryLocalInterface instanceof IRemoteHeartRateBeltController)) {
                return (IRemoteHeartRateBeltController) queryLocalInterface;
            }
            return new Proxy(iBinder);
        }

        @Override
        public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
            if (i == TRANSACTION_setWarnHr) {
                parcel.enforceInterface(DESCRIPTOR);
                boolean warnHr = setWarnHr(parcel.readInt());
                parcel2.writeNoException();
                parcel2.writeInt(warnHr ? 1 : 0);
                return true;
            } else if (i == TRANSACTION_closeWarnHr) {
                parcel.enforceInterface(DESCRIPTOR);
                boolean closeWarnHr = closeWarnHr();
                parcel2.writeNoException();
                parcel2.writeInt(closeWarnHr ? 1 : 0);
                return true;
            } else if (i == TRANSACTION_initWarnHr) {
                parcel.enforceInterface(DESCRIPTOR);
                initWarnHr();
                parcel2.writeNoException();
                return true;
            } else {
                if (i == INTERFACE_TRANSACTION) {
                    parcel2.writeString(DESCRIPTOR);
                    return true;
                }
                return super.onTransact(i, parcel, parcel2, i2);
            }
        }

        public static class Proxy implements IRemoteHeartRateBeltController {
            public static IRemoteHeartRateBeltController sDefaultImpl;
            private final IBinder mRemote;

            public String getInterfaceDescriptor() {
                return Stub.DESCRIPTOR;
            }

            Proxy(IBinder iBinder) {
                this.mRemote = iBinder;
            }

            @Override
            public IBinder asBinder() {
                return this.mRemote;
            }

            @Override
            public boolean setWarnHr(int i) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    obtain.writeInt(i);
                    boolean z = false;
                    if (!this.mRemote.transact(TRANSACTION_setWarnHr, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().setWarnHr(i);
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public boolean closeWarnHr() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    boolean z = false;
                    if (!this.mRemote.transact(TRANSACTION_closeWarnHr, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().closeWarnHr();
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void initWarnHr() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_initWarnHr, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().initWarnHr();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }
        }

        public static boolean setDefaultImpl(IRemoteHeartRateBeltController iRemoteHeartRateBeltController) {
            if (Proxy.sDefaultImpl == null) {
                if (iRemoteHeartRateBeltController == null) {
                    return false;
                }
                Proxy.sDefaultImpl = iRemoteHeartRateBeltController;
                return true;
            }
            throw new IllegalStateException("setDefaultImpl() called twice");
        }

        public static IRemoteHeartRateBeltController getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }
    }
}
